package enumClass;

public class listEnumClass {
    public static void main(String[] args) {
        // 枚举类的values()方法用于返回枚举类的所有实例
        Direction[] values = Direction.values();
        for (Direction value : values) {
            System.out.println(value);
        }

        Thread.State[] values1 = Thread.State.values();
        for (Thread.State value : values1) {
            System.out.println(value);
        }

        // 枚举类的valueOf()方法用于返回指定名称的枚举类实例
        Direction east = Direction.valueOf("EAST");
        System.out.println(east);

        // toString()方法返回枚举类实例的名称
        System.out.println(east.toString());
    }
}

enum Direction {
    EAST, WEST, NORTH, SOUTH
}
